package com.example.demo.client.vm.sysbasequery;

import com.example.demo.client.vm.cssmqry.region.RegionVm;
import com.example.demo.format.TreeFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Description:
 *
 * @Author zmf
 * @Date 2018/12/13  11:06
 */
@ApiModel("角色树")
public class RoleTreeVm implements TreeFormat<RoleTreeVm, Long>, Serializable {
    private static final long serialVersionUID = -2883227869887464932L;
    @ApiModelProperty("角色ID")
    private Long roleId;
    @ApiModelProperty("角色名称")
    private String roleName;
    @ApiModelProperty("角色编码")
    private String roleCode;
    @ApiModelProperty("父角色ID")
    private Long parentId;
    @ApiModelProperty("描述")
    private String description;
    @ApiModelProperty("创建人")
    private String createUserName;
    @ApiModelProperty("创建时间")
    private String createTime;
    @ApiModelProperty("修改人")
    private String updateUserName;
    @ApiModelProperty("修改时间")
    private String updateTime;
    @ApiModelProperty("角色类型：1：角色，2：目录")
    private Integer roleFlag;
    @ApiModelProperty("子元素")
    private List<RoleTreeVm> children;
    @ApiModelProperty("是否选中")
    private boolean checked = false;
    @ApiModelProperty(value = "关联类型",notes = "1:直接关联，2：通过用户组关联")
    private Integer relateType;
    @ApiModelProperty("区域id")
    private Long regionId ;
    @ApiModelProperty("全量区域id")
    private String fullRegionId;
    @ApiModelProperty("关联区域信息")
    private RegionVm regionVm;

    @Override
    public Long getId() {
        return roleId;
    }

    @Override
    public Long getParentId() {
        return parentId;
    }

    @Override
    public void addChildren(RoleTreeVm child) {
        if (this.children == null) {
            this.children = new ArrayList<>();
        }
        this.children.add(child);
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getCreateUserName() {
        return createUserName;
    }

    public void setCreateUserName(String createUserName) {
        this.createUserName = createUserName;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getUpdateUserName() {
        return updateUserName;
    }

    public void setUpdateUserName(String updateUserName) {
        this.updateUserName = updateUserName;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getRoleFlag() {
        return roleFlag;
    }

    public void setRoleFlag(Integer roleFlag) {
        this.roleFlag = roleFlag;
    }

    public List<RoleTreeVm> getChildren() {
        return children;
    }

    public void setChildren(List<RoleTreeVm> children) {
        this.children = children;
    }

    public boolean isChecked() {
        return checked;
    }

    public void setChecked(boolean checked) {
        this.checked = checked;
    }

    public Integer getRelateType() {
        return relateType;
    }

    public void setRelateType(Integer relateType) {
        this.relateType = relateType;
    }

    public Long getRegionId() {
        return regionId;
    }

    public void setRegionId(Long regionId) {
        this.regionId = regionId;
    }

    public String getFullRegionId() {
        return fullRegionId;
    }

    public void setFullRegionId(String fullRegionId) {
        this.fullRegionId = fullRegionId;
    }

    public RegionVm getRegionVm() {
        return regionVm;
    }

    public void setRegionVm(RegionVm regionVm) {
        this.regionVm = regionVm;
    }

    public String getRoleCode() {
        return roleCode;
    }

    public void setRoleCode(String roleCode) {
        this.roleCode = roleCode;
    }

    @Override
    public String toString() {
        return "RoleTreeVm{" +
                "roleId=" + roleId +
                ", roleName='" + roleName + '\'' +
                ", parentId=" + parentId +
                ", description='" + description + '\'' +
                ", createUserName='" + createUserName + '\'' +
                ", createTime='" + createTime + '\'' +
                ", updateUserName='" + updateUserName + '\'' +
                ", updateTime='" + updateTime + '\'' +
                ", roleFlag=" + roleFlag +
                ", children=" + children +
                ", checked=" + checked +
                ", relateType=" + relateType +
                ", regionId='" + regionId + '\'' +
                ", fullRegionId='" + fullRegionId + '\'' +
                ", regionVm=" + regionVm +
                '}';
    }
}
